MdbDbi

Resource class for MDB_dbi handles.

@note Instances of this class are movable, but not copyable. @see http://symas.com/mdb/doc/group__mdb.html#gadbe68a06c448dfb62da16443d251a78b

Constructors

this
this(MDB_dbi handle)

Constructor. Param: handle = a valid MDB_dbi handle

Destructor

~this
~this()

Destructor.

Members

Functions

close
void close(MdbEnv env)

Close a database handle Param: env = an MdbEnv

del
bool del(MDB_txn* txn, K key)

Removes a key/value pair from this database.

del
bool del(MDB_txn* txn, MdbVal key)

Removes a key/value pair from this database.

drop
void drop(MDB_txn* txn, bool del)

@param txn a transaction handle @param del @throws lmdb_oo.MbdError on failure

flags
uint flags(MDB_txn* txn)

Retrieves the flags for this database handle.

get
bool get(MDB_txn* txn, MdbVal key, MdbVal data)

Retrieves a key/value pair from this database.

get
bool get(MDB_txn* txn, K key)

Retrieves a key from this database.

get
bool get(MDB_txn* txn, K key, V val)

Retrieves a key/value pair from this database.

get
bool get(MDB_txn* txn, char* key, V val)

Retrieves a key/value pair from this database.

handle
MDB_dbi handle()

Returns the underlying MDB_dbi handle.

put
bool put(MDB_txn* txn, MdbVal key, MdbVal data, uint flags)

Stores a key/value pair into this database.

put
bool put(MDB_txn* txn, K key, uint flags)

Stores a key into this database.

put
bool put(MDB_txn* txn, K key, V val, uint flags)

Stores a key/value pair into this database.

put
bool put(MDB_txn* txn, char* key, V val, uint flags)

Stores a key/value pair into this database.

put
bool put(MDB_txn* txn, char* key, char* val, uint flags)

Stores a key/value pair into this database.

set_compare
MdbDbi set_compare(MDB_txn* txn, MDB_cmp_func* cmp)

Sets a custom key comparison function for this database.

size
size_t size(MDB_txn* txn)

Returns the number of records in this database.

stat
MDB_stat stat(MDB_txn* txn)

Returns statistics for this database.

Static functions

open
MdbDbi open(MDB_txn* txn, char* name, uint flags)

Opens a database handle.

Static variables

default_flags
uint default_flags;

< Default flags

default_put_flags
uint default_put_flags;

< Default flags

Variables

_handle
MDB_dbi _handle;
Undocumented in source.

Meta